// src/router/index.js
import { createRouter, createWebHistory, createWebHashHistory  } from 'vue-router';
import Login from '../components/Login.vue';
import AdminLogin from '../components/AdminLogin.vue';
import UserLogin from '../components/UserLogin.vue';
import Register from '../components/Register.vue';
import Dashboard from '../components/Dashboard.vue';
import RequestPublish from '../components/RequestPublish.vue';
import ServiecePublish from '../components/ServicePublish.vue';
import UserInfo from '../components/UserInfo.vue';
import OrderComplaint from '../components/OrderComplaint.vue';
import StuInfo from '../components/StuInfo.vue';
import AdminDashboard from '../components/AdminDashboard.vue';
import DealComplaint from '../components/DealComplaint.vue';

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/admin-login',
    name: 'AdminLogin',
    component: AdminLogin
  },
  {
    path: '/user-login',
    name: 'UserLogin',
    component: UserLogin
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: Dashboard
  },
  {
    path: '/request-publish',
    name: 'RequestPublish',
    component: RequestPublish
  },
  {
    path: '/service-publish',
    name: 'ServicePublish',
    component: ServiecePublish
  },
  {
    path: '/user-info',
    name: 'UserInfo',
    component: UserInfo
  },
  {
    path: '/order-complaint/:orderID/:complained',
    name: 'OrderComplaint',
    component: OrderComplaint
  },
  {
    path: '/stu-info/:userID',
    name: 'StuInfo',
    component: StuInfo
  },
  {
    path: '/admin-dashboard',
    name: 'AdminDashboard',
    component: AdminDashboard
  },
  {
    path: '/dealComplaint/:ID/:OrderID/:Type/:reason/:content/:complained',
    name: 'dealComplaint',
    component: DealComplaint
  }
];

const router = createRouter({
    history: createWebHashHistory (),
    routes,
  });

  export default router;